IRedSonI
IRedSonI

Reputation: 1

I am supposed to write an assembly level program that prints my name using the LDBA instruction with direct addressing in Pep 9

So in Pep 9 there is an example of a way to print out the .ascii "hi".

;File: fig0433.peph   
;Computer Systems, Fifth edition  
;Figure 4.33

         LDBA    0x000D,d    ;Load byte accumulator 'H'
         STBA    0xFC16,d    ;Store byte accumulator output device
         LDBA    0x000E,d    ;Load byte accumulator 'i'
         STBA    0xFC16,d    ;Store byte accumulator output device
         STOP                ;Stop
        .ASCII  "Hi"        ;ASCII "Hi" characters
        .END

I tried to use the name logic to write my name but the output showed weird characters: Ñ
Could someone explain to me why this logic does not work and I would like someone to steer me in the right direction.

;Stan Warford   
;May 1, 2016   
;A program to output "Hi"   
;   

         LDBA    0x000C,d    ;Load byte accumulator 'A'
         STBA    0xFC16,d    ;Store byte accumulator output device
         LDBA    0x000D,d    ;Load byte accumulator 'r'
         STBA    0xFC16,d    ;Store byte accumulator output device
         LDBA    0x000E,d    ;Load byte accumulator 'i'
         STBA    0xFC16,d    ;Store byte accumulator output device
         LDBA    0x000F,d    ;Load byte accumulator 'e'
         STBA    0xFC16,d    ;Store byte accumulator output device
         LDBA    0x0010,d    ;Load byte accumulator 'l'
         STBA    0xFC16,d    ;Store byte accumulator output device
         STOP                ;Stop
         .ASCII  "Ariel"        ;ASCII "Ariel" characters
         .END

Upvotes: 0

Views: 4198

Answers (0)

Related Questions