Test 2 Study guide

Test 2 Study guide - Useful facts Registers are AX,BX,DX...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Useful facts Registers are AX,BX,DX The counter is CX segment addresses o take given segment register o to get starting address place zero at the end o to get ending address you start from rightmost bit, as you go from right to left put “F” for zero’s until you hit a non-zero bit, that first non-zero bit gets decremented by one, then move to the leftmost bit and increment that by one o EX: segment register starting address ending address 2000H 20000H 2FFFFH 2001H 20010H 3000FH 2100H 21000H 30FFFH AB00H AB000H BAFFFH 1234H 12340H 2233FH Default segment and offset registers o Segment offset special purpose CS IP instruction address SS SP or BP stack address DS BX,DI,SI data address ES DI for string string destination address Assembler details Directives (procedure) o Statements to direct the assembler on how to proceed in the assembly process PROC and ENDP o PROC = start of procedure, must be followed with a: NEAR – one the resides in the same code segment as the program, local FAR – may reside at any location in the memory system, global o ENDP = end procedure o If the structure is to be violated for any reason use: CALLF = call far CALLN = call near RETF = return far RETN = return near Each appears with the name of the procedure Some directives are: PAGE 135. o DUP = duplicates 10 DUP (?) – reserves 10 locations of memory of no specific value 10 DUP (6) – reserves 10 locations of memory of the value 6.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
o ASSUME = Tells the assembler what names have been chosen for the code, data, extra, and stack segments. o And some others: BYTE, DB,END,EQU,FAR, OFFSET,SEGMENT,STACK,USES. EX: BLUE = DIRECTIVES, PURPLE = LABELS o MYDATA SEGMENT VAR1 DW OBC1H VAR2 DB 7, 36 VAR3 DW 3 DUP (789AH,?) MYDATA ENDS BIGSTACK SEGMENT DW 50 DUP (?) TOP_OF_STACK LABEL WORD BIGSTACK ENDS CODERED SEGMENT ASSUME CS: CODERED, DS: MYDATA, SS: BIGSTACK MASK EQU 00010001B LAST EQU 4 BEGIN: MOV DX, MYDATA MOV DS, DX MOV DX, BIGSTACK MOV SS, DX MOV SP, OFFSET TOP_OF_STACK MOV AX, VAR3 CMP AX, VAR1 JE TAG ADD AX, WORD PTR VAR2 TAG: OR AX, MASK ADD VAR3+4, AX SUB VAR1, AX HLT CODERED ENDS END BEGIN Labels Cannot exceed 31 characters Cannot be an instruction mnemonic or a directive Consist of: o Alphabetic characters both upper and lower o Digits 0 through 9 o Special characters (?),(.),(@),and ($) First character cannot be a digit The period can only be used as the first character, using this is not recommended Must end with a colon when it refers to an opcode generating instruction Does not need to end with colon when referring to a directive
Background image of page 2
Comments Begin with a “;” Ignored by assembler On line by itself or at end of line Make it easier for someone to read and understand the program Procedure Group of instructions that usually performs one task.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/25/2012 for the course EE 3750 taught by Professor Desouza during the Fall '08 term at LSU.

Page1 / 16

Test 2 Study guide - Useful facts Registers are AX,BX,DX...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online