-1

Consider the following assembler output listing:

START 100
MOVER BREG, ONE                                101) + 04 2 105 
MOVEM BREG, RESULT                             102) + 05 2 106
PRINT RESULT                                   103) + 10 0 106
STOP                                           104) + 00 0 000
ONE DC '1'                                     105) + 00 0 001
RESULT DS 1                                    106) 
  1. What does the + sign before code signifies?
  2. Why is the address of ONE given 001?
  3. Why is the entry after the last RESULT DS 1 statement left blank?

This listing appears in Systems Programming and Operating Systems by Dhamdhere (editor's note: as discovered by an answerer).

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
paragjain
  • 265
  • 1
  • 5
  • 12

3 Answers3

3

I don't know which assembler you are using (it might have beem sensible to give that information in your question) so these are not particularly well-informed answers:

  1. Don't know - what does your assembler's manual say
  2. It isn't - that's the value
  3. DS just reserves some space

Edit: An assembler is a computer program that takes text containing assembly language and turns it into machine code. It can also produce output in human readble form, which is what the code you posted appears to be. The format of the human readble form is specific to the particular assembler (i.e. program) that you are using - it is not specific to the machine architecture the assembler emits machine code for.

  • The 8086 is a CPU - an assembler is a software package. Which assembler software package are you using? –  Mar 24 '09 at 19:50
  • i m not using any assembler software package what, i meant is that what if this machine instructions set is of 8086 microprocessor? i wrote this code from my course text book machine instruction format mentioned in book is 1st one for sign 2 for opcode 1 for reg operand 3 for memory operand – paragjain Mar 24 '09 at 20:07
  • sorry - I don't understand. Which book are you talking about? –  Mar 24 '09 at 20:53
  • in above assembler output at address 101 + is for sign 04 is opcode for some instruction(in above for MOVER) 2 is i think a register(may be B Register) 105 is memory operand so what i m asking is that what does this sign is for is it machine architecture dependent and if yes what does it signifies – paragjain Mar 24 '09 at 21:11
  • its not my homework i m just trying to learn assembly language at a elementary level – paragjain Mar 26 '09 at 20:06
3

This appears to be using the simple assembly language in Chapter 4 of Systems Program and Operation.

In the description of the opcode output, it says, "The sign is not a part of the instruction." A quick perusal of the text didn't reveal what it is part of, and all of the examples have "+" in that column.

Jim Mischel
  • 131,090
  • 20
  • 188
  • 351
  • its the same text that you linked in here just wanted to know the 3 things that i asked in my question...... thanks – paragjain Mar 26 '09 at 20:02
1
  1. "+" Sign is not part of the instruction. ( That side of numeric instructions are machine instruction )

  2. Address of ONE is 105 and 001 is value assigned to ONE by using DC which is short form of declare constant.

    DC reserve memory word space and assign the constant.

  3. The entry of RESULT DS 1 left blank because DS reserves memory space of given requirement here only 1 is given so it only reserves one memory word location.

Other side of only numeric part is machine instruction it follows below format

Sign opcode register_opcode memory_operand

For example,

101) memory location
+ Sign (not part of instruction)
04 Machine opcode ( occupy 2 digits )
2 Register operand ( occupy 1 digit )
105 Memory operand ( occupy 3 digits )

Note : It's simple assembly language for a hypothetical computer which is used to illustrate features and techniques of assemblers.

Community
  • 1
  • 1