OSWRCH

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

OSWRCH

Post by Ric » Tue 17 Apr 2018, 21:26

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

guest
Posts: 150
Joined: Mon 02 Apr 2018, 09:12

Re: OSWRCH

Post by guest » Tue 17 Apr 2018, 21:53

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: 6
Joined: Tue 17 Apr 2018, 21:03

Re: OSWRCH

Post by Ric » Wed 18 Apr 2018, 17:19

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

Post Reply