Jump to content

Recommended Posts

Posted

Hi,

 

I am new to computer science and am having a hard time understanding assembly language programming. I have an assignment to write an Pep/8 assembly language program to output my first and last name on the output device using direct addressing with a .ASCII pseudo-op.

 

She gave us an example on a powerpoint, but I don't understand it.

 

 

 

CHARO 0x000D,d

CHARO 0x000E,d

CHARO 0x000F,d

CHARO 0x0010,d

STOP

; ----- SOD -----

.ASCII “KimT"

.END

 

I know that direct addressing means I will be fetching the character stored in the location specified. What I don't understand is where the numbers come from. 0x000D = K?

 

I know that they are written in hex, so I thought maybe it was the hex values on the ASCII table.. but it's not. Where do they come from?

 

Any help it all is greatly appreciated! Thanks!

Posted

Hi,

 

I am new to computer science and am having a hard time understanding assembly language programming. I have an assignment to write an Pep/8 assembly language program to output my first and last name on the output device using direct addressing with a .ASCII pseudo-op.

 

She gave us an example on a powerpoint, but I don't understand it.

 

 

 

CHARO 0x000D,d

CHARO 0x000E,d

CHARO 0x000F,d

CHARO 0x0010,d

STOP

; ----- SOD -----

.ASCII “KimT"

.END

 

I know that direct addressing means I will be fetching the character stored in the location specified. What I don't understand is where the numbers come from. 0x000D = K?

 

I know that they are written in hex, so I thought maybe it was the hex values on the ASCII table.. but it's not. Where do they come from?

 

Any help it all is greatly appreciated! Thanks!

 

Its been a few years since i had to use assembly language but i believe the line 'ASCII "KimT"' creates a buffer in your code containing the ascii values for "KimT" in this case.

The value 0x000D is an offset from the start of the program to the first character of this buffer, 0x000E points to the second character etc.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.