Register example essay topic
Pointing Registers: diDdiestintaion index si Source index sp stack pointer b pBase pointer The main purpose of the above stated registers is to point to other areas in memory. Segment- sc Code segment ds Data segment ss Extra segment The main purpose of the above stated registers is to hold segments of information. 3) List all the 8086 flags and state their purpose. Group them by by state or control, they are: State Flags: State flags are so named becouse their values are influenced by the precious intructions and reflect some peculiarities as a result. AF Auxiliary Carry Flag CF Carry Flag OF Overflow Flag PD Parity Flag SF Sign Flag ZF Zero Flag Control Flag: Control Flags are so named becouse their purpose is to control the execution of certain intructions. IF Interrupt Flag TFT rap Flag DF Direction Flag 4) Define Ram and Rom ROM – Read Only Memory -Permanent – non-voli tale (is kept at shut-down) RAM – Random Access Memory -Changeable -Voli table (is not kept at shut-down) 5) State and define the three busses used by the CPU. also state if the bus is unidirectional or bidirectional.
They are: Address-Bidirectional hardware Data -Bidirectional Sends info (Carry's info as well) Control-Unidirectional Mouse, Keyboard, etc 6) A program that will take a single digit numeric input from the computer, convert it to BCD, ass the number, and output the result to the monitor... Model. stack 100 h. code Start: mov ah, 01 h Int 21 h mov ax, 001 h cmp al, 09 h Jnz convert; jnz = jump not zero mov ax, 4 C 00 h int 21 h end start Convert add ax, 01 h; add 1 if over 9 ret 7) State the difference between a macro and a procedure. Macro – Copies code a compilating / inserts Procedure – Jumps to instruction in memory 8) Give examples of the following addressing modes: Register – mov ax, cx Indirect – mov ax, 6000 h mov ds, ax Direct – mov ax, [0123 h] Indexed – mov ax, [bx + di] 9) Define the following assembler directives: Extern – External to current code Public – Can be called (internal) Global – Combination of both 10) For every ' push' there is a ' pop' 11) Write a program that will encrypt a string by XO Ring one character with the next character in the string... Model tiny. Data grab db "this'. code start: mov ax, @ data mov ds, ax lea bx, grab lea si, grab stinc: inc si xor [bx] [si]; [T] [H] inc bx comp si, 03 h jne stinc mov ax 4 ch int 21 end start 12) Write a program that will decrypt the program you just wrote... Model tiny.
Data grab db "this'. code start: mov ax, @ data mov ds, ax lea bx, grab lea si, grab lea dx, to inc add bx, 04 h add si, 04 h stinc dec si xor [bx] [si] dec bx cmp si, dx jne stinc int 21 end start 13) State the address 5 F 32 A of the next op-code as a segmented address, a logical address. Give the offset address and the segment address. 5 F 32 and shift to right 500000 = F 32 A 14) List all the base-pointers registers and give the segments that they can use. Label the default segment register with each.
Don't forget about IP – Ip must pair with cs, sp with ss becouse these registers are involved in automatic CPU operations. Then you can pair the general-purpose data pointing registers BX, Di, and SI with the data segment register DS – The IP offset register is always asses to the CS segment register when addressing code memory. There is override available to the programmer. – The BP or SP offset register is automatically added to the SS segment register when stack operations are in progress.
The programmer may not override the automatic selection of SS with SP. The programmer may override the automatic selection of the DS register and use anyone of the other three segment registers CS, ES, or SS. – Any offset quantity using registers BX, DI, and Si is automaticlly added to the DS base register. – The offset register DI is automaticlly used with the ES base register when string operations are taking place. The programmer may not override the selection of Di with ES when string operations are done. 15) Give an example of a struct that will store the data for a person age, height, and weight.
HEALTH STRUCT age dw 0 h height+dw 0 h weight+dw 0 h health ends.
