Login
Back to forumSee the full topicGo to last reply

Posted By

gerliczer
on 2011-09-11
16:31:03
 Re: Draw a single pixel in assembler

Hi George,

The line ORG $1001-2 will make the code compiled to address $0FFF. This is necessary, because program files start with load address. The next line DW $1001 simply defines this address, but if it is not at the correct position then the complied file will be loaded at the wrong memory area. For example if the first line would be ORG $1001, then everything that follows will be complied at two bytes offset. This would result in JMPs' and JSRs' address having two byte offsets too, so jumps would occur to wrong addresses.

The next block is the definition of one BASIC line that will start the assembly program with a SYS instruction.

The SEI is for stopping the interrupts is necessary because the default interrupt handler is in the KERNAL ROM, and the next STA $FF3F instruction will page in the underneath lying RAM, therefore an incoming interrupt without setting up a proper handler this way quite surely would crash.

Did this help?



Back to top


Copyright © Plus/4 World Team, 2001-2024