OSWRCH

Discussions related to using the integrated assembler
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

OSWRCH

Post by Ric »

Completing simple VDU commands in assembler like VDU 5 is a simple process

mov al, 5
call "oswrch"

but how do you complete more complicated commands like

VDU 25,4,500,500

Can someone please help

Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
guest

Re: OSWRCH

Post by guest »

Ric wrote: Tue 17 Apr 2018, 21:26 but how do you complete more complicated commands like
VDU 25,4,500,500
They are not really "more complicated". Separating the parameters with commas is equivalent to using individual VDU statements, it's just a shorthand. So your example is exactly equivalent to (but probably slightly faster than):

Code: Select all

      VDU 25 : VDU 4 : VDU 500 : VDU 500
However I would want to point out that VDU sends a byte stream so only values in the range 0 to 255 can be sent; larger values (such as your 500) will be evaluated 'MOD 256' so in fact what you are really doing is this:

Code: Select all

      VDU 25 : VDU 4 : VDU 244 : VDU 244
Or in x86 assembly language:

Code: Select all

      mov al,25 : call "oswrch"
      mov al,4 : call "oswrch"
      mov al,244 : call "oswrch"
      mov al,244 : call "oswrch"
Unless you intended to use semicolons rather than commas in your example, of course. VDU 25,4,500;500; would be:

Code: Select all

      mov al,25 : call "oswrch"
      mov al,4 : call "oswrch"
      mov al,244 : call "oswrch"
      mov al,1 : call "oswrch"
      mov al,244 : call "oswrch"
      mov al,1 : call "oswrch"
Richard.
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: OSWRCH

Post by Ric »

Thanks Richard
I feel abit silly for asking now because I should have remembered back to the good old days and the 6502 instructions.
Regards Ric
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023