Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Assembly Language Programming

Name: Anonymous 2013-04-02 23:58

Microprocessor Concepts and Assembly Language Programming

Objectives:

• Get familiar with the structure of an assembly language program.
• Use instructions to construct loops for a simple algorithm.

• Use DOS interrupts (or service routines) for basic I/O operations.

•Use proper instructions to do basic calculation and check for overflow.

Develop on paper the algorithm and draw the corresponding flowchart for the program below:

Define an array of any 20 arbitrary 8-bit unsigned numbers in the Data Segment. Determine the sum of all odd numbers and the sum of all even numbers. Compare and determine if the sum of all odd numbers is larger than, equal to or smaller than the sum of all even numbers. Print a proper message on the screen based on the result.

Hints:

• As you enter a key, say „1‟, in the keyboard, the ASCII code of „1‟ will be read in. Likewise, if you output a key say „1‟ to the monitor, you have to output the ASCII code of „1‟ to the monitor, not „1‟ itself.

• The ASCII code of keys can be viewed using:

Helppc -> Uncategorized/Miscellaneous Topics -> ASCII under column 3, and column 4 or 6.
The ASCII codes of 0, 1, … , 9 are 30h, 31h, …, 39h.
The ASCII codes of A, B, …, Z are 41h, 42h, …, 5Ah.
The ASCII codes of a, b, …, z are 61h, 62h, …, 7Ah.
The ASCII codes of LF (line feed) is 0Ah, CR (carriage return) is 0Dh, and ESC-key is 1Bh.

• As a character such as 'A' is entered at the keyboard, the INT 21h,7 can be invoked to obtain the ASCII code of 'A' in the AL register. That is AL <= 41h. Here is how to use.

First, you set up a loop with the following lines:

MOV AH, 7

INT 21h

As soon as you enter key 'A' at the keyboard, the value 41h will be stored in AL. Thus, you can store this value right away, into a register or a memory location:

MOV BL, AL

BL now has 41h.

• The Interrupt such as INT 21h, 7 can be viewed using
Helppc -> Interrupt Services DOS-BIOS-EMS-Mouse -> int a, b where a is the interrupt number and b is the service number. In this case, 21h is the interrupt number, and 7 is the service number. Both a and b are hexadecimal numbers.

• If you want to display a character such as 'A' on the monitor, you need to place the ASCII code of 'A' that is 41h on DL register, before invoking the INT 21h, 2. Here is how to use.

MOV DL, 41h

MOV AH, 2

INT 21h

As soon as INT 21h is invoked, the monitor will display 'A' at its current cursor position.

• INT 21h, 9 is used to display a string on the monitor, whereas INT 21h, 4Ch is used to terminate the program normally. Refer to HELPPC for detailed descriptions.

• The oddity of numbers could be checked by bit-wise “AND” instruction or “TEST” instruction. Refer to HELPPC or an instruction manual for the detailed description of these instructions.

• Be careful of data width and overflow. The sum of 8-bit numbers can easily be greater than 255. Thus, you may use WORD variables to save the sums. In this case, you must match the width of both operands when using ADD to accumulate.

• You can compare the sum of odd and even numbers by first subtracting one from the other followed by conditional jumps. Refer to an instruction manual for the details of the conditional jumps.

• Try different numbers in the array to fully test your program. When you showcase your code, depend on the client/your boss may require you to modify the numbers.

• If you need a powerful editor for all the programming needs, Notepad++ is a good choice. Download this freeware at: http://notepad-plus.sourceforge.net/


Sample Algorithm (you may have better way of doing it):

1. Pre-store the numbers in the Data Segment

2. Initialize the stack and code segments.

3. Define SUM_ODD, and SUM_EVEN, initialize them to zero.

4. In a loop, get each number and check for even or odd.

• If it's even, add it to SUM_EVEN.

• If it's odd, add it to SUM_ODD

5. Upon completion of the looping, compare the two sums.

• If SUM_EVEN > SUM_ODD, jump to display message 1.

• If SUM_EVEN = SUM_ODD, jump to display message 2.

• If SUM_EVEN < SUM_ODD, jump to display message 3.

6. Quit using INT 21H, 4Ch.

Name: Skeleton Program 2013-04-03 0:02

Continue :

Skeleton Program:

A skeleton which has all the necessary parts of a working assembly program is provided below. You should understand fully the use of each part, and insert your own codes into this skeleton to create your own program.

1 ; This is a skeleton program which has:
2 ; Data Segment - where you define your variables, messages and arrays.
3 ; Stack Segment - which is necessary as you will use interrupts and subroutines.
4 ; Code Segment - where your codes are.
5 ; Segment Initializations - necessary to any program.
6 ; Interrupt call for exit - to go back to the operating system.
7 ; Build your own program on this sample.
8 ; Copyright by The Genius Programmer, Best in America and the world
9
10 ; Data Segment
11 DATA SEGMENT
12
13 DATA ENDS
14
15 ; Stack Segment
16 STK SEGMENT STACK
17 DB 1024 DUP (?) ; 1 Kb Stack. Do not make this stack too small!
18 STK ENDS
19
20 ; Code Segment
21 CODE SEGMENT
22 ASSUME CS:CODE, DS:DATA, SS:STK
23
24 start: ; Entry Point
25 ; Initialization of DS and SS
26 MOV AX, DATA
27 MOV DS, AX
28
29 MOV AX, STK
30 MOV SS, AX
31
32 ; Beginning of you codes here
33
34 ; End of your codes
35
36 exit: MOV AH, 4Ch ; Interrupt function number for exit
37 INT 21h
38 CODE ENDS
39 END start

Name: Anonymous 2013-04-03 0:35

The fuck year is this? 1986?

Name: Anonymous 2013-04-03 2:12

The fuck board is this? /g/?

Name: Anonymous 2013-04-03 2:41

>>4
LLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
>EGINGWIMGOIN GROOOOO!!!!!!!!!!!!!!!!!!!!!
>LE EGIN FACE WHEN GRO IS EGIN XDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDd

Name: Zilog 2013-04-03 10:45

>>3

Why is companies like Zilog still using Assembly Language for their microprocessor then when they claim that some critical routines were written by assembly language? : www.zilog.com/docs/software/um0075.pdf

Name: Anonymous 2013-04-03 17:57

>>6
People use assembly but not DOS on 16-bit x86. Stack segments are obsolete as fuck.

Name: Anonymous 2013-04-04 0:57

>>7

REALLY, I am an high school college student and I am surprised the school still teach this obsolete shit! Education is really an big scam

Name: Anonymous 2013-04-04 1:08

First off, don't bother thinking that I'm going to read all that shit. Condense it down to five lines next time. I refuse to read any of it until you change it.

Anyway, on to assembly language, which is what I'm just going presume that your thread is about.

I once saw a guy make FASM generate a bitmap of the Mandelbrot set using only FASM macros that generated each little db. It was neat-o, but it was also 2006, and now I can't find it.

>>8
Yeah, you tell them! You should totally drop out now and go and implement your greatness with out all that obsolete shit like "fundamentals" and sophist "computation on something other than a theoretical Turing machine that with infinite everything" lessons.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-04-04 5:12

>>7
It's still good to learn about how things were done back then, because it gives you a better understanding of why things are they way they are today.

I know some EE classes still involve interfacing floppy drives, because a modern hard drive is much too complex to play with at the physical level (and everything tends to be undocumented and proprietary).

Likewise I recommend learning the Z80 (8080, 8085 too) before going to x86.

Name: Anonymous 2013-04-04 5:15

>>10
your mom is a z80

Name: Anonymous 2013-04-04 5:18

>>10
Cudder I will find you and rape you and consume all of your organs while keeping you alive to witness it. I swear on me mum.

Name: Here is your diagnosis 2013-04-04 5:56

>>9

If you can only read up to five lines of code, either you suck in programming mean you can only create 5 lines of code that totally cannot run and execute, or you have dyslexic. Either way you should seek professional help and call this hotline : 1-800-X-I-DON'T-KNOW-PROGRAMMING-AND-HOW-TO-READ-SO-I-NEED-HELP-BADLY .

Name: tief of hearths !FQ8iiartCY 2013-04-04 6:03

yes.

Name: Anonymous 2013-04-04 8:16

>>12
Fuck you, Cudder-sama is hot!

Name: 14 !FQ8iiartCY 2013-04-04 9:16

lol
so do i need to use a hex editor and just save as .exe ?

Name: Anonymous 2013-04-04 10:02

>>10
Z80 is an ugly piece of shit. That's where x86 gets it from.

Name: Anonymous 2013-04-04 10:14

>>10
jew

Name: Anonymous 2013-04-04 10:46

>>15
You're not fooling anyone, Shudder(because everyone cringes at the sight of your disgusting hormonally fucked visage)

/polecat kejpabs/ (and stay there this time)

Name: Anonymous 2013-04-04 12:00

>>19
Cudderwitz is a Jew like Mark Shudderberg.

Name: Anonymous 2013-04-04 14:58

Cuddersteinbergwitzmansky

Name: Anonymous 2013-04-04 15:02

>>21
Cuddersteinbergwitzmanskyvichev

Name: Anonymous 2013-04-04 15:14

>>22
Cudderfeldbaumsteinbergwitzmanskyvichev

Name: Anonymous 2013-04-04 15:20

>>1,2
Thanks for trying, this board is fucked, lets move to /s4s/

Name: Anonymous 2013-04-04 15:25

>>24
Shalom, Hymie!

Name: Anonymous 2013-04-04 16:43

>>24
Where is that?

Name: !FQ8iiartCY 2013-04-04 21:11

so Nasm / Tasm / etc?
....How many different instructions are there on modern(-ish) hardware these days ?

Name: Anonymous 2013-04-04 21:23

>>27
Do you want to know all of them or just the ones assembly programmers and compilers actually use?

Name: !FQ8iiartCY 2013-04-04 21:32

ah, just a few ball-park numbers would be fine

Name: Anonymous 2013-04-04 21:43

>>29
MIPS has 4294967296 instructions.

Name: !FQ8iiartCY 2013-04-04 22:06

yeesh, but i guess a lot of those could be built from a smaller subset ? eg op1 + op2 + opX -> opXXXX

Name: Flowchart/Lookup table 2013-04-12 2:28

Continue

Flowchart and Lookup table

A) Flowchart

- used to design the control flow of a software-based system.

- A program documentation for easy future modification.

B) Flowchart Symbol

- Process - indicate arithmetic or procedural operation, e.g Compute grade

- Predefined process - used to call a subroutine. e.g Average

- Input/Output - used for input/output operation. e.g Read Score

- Decision - used to ask a question.

e.g Is it true? → Yes
       
       ↓
                                            
       No

- Connector - allows flowchart to be drawn without crisscrossed flow lines e.g ③

- Terminal - indicates start or end point.

C) Direct table lookup for data conversion

- Used to convert data from one form to another.

- The common one is BCD/hex-to-7-segment

Name: Anonymous 2013-04-12 5:20

tried assembling this with nasm.. but it didn't work, i think i need a linker?

;Testname=test; Arguments=-fbin -ofar64.bin; Files=stdout stderr far64.bin
; BR 2039212
    bits 64

    call qword far [rax]
    jmp qword far [rax]
    call dword far [rax]
    jmp dword far [rax]
    call far [rax]
    jmp far [rax]

Name: PCI 2013-04-14 23:17

Program Control Instructions

• are instructions which allow the flow of the execution of a program to be altered.

• allow the computer to make decisions and modify the flow of the program based upon the outcome of the decision.

• 2 types of program control instructions:

* JUMP

* CALL

Jump Instructions

• allow the program to jump to any location in the memory to continue a program.

• the important of the JUMP is that a task can be repeated over and over without programming the computer.

JUMP

{ Unconditional Jump { JP addr (3 bytes) JR dd (2 bytes) Indirect Jump e.g. JP (HL)

{ Conditional Jump  { Long form (3 bytes): Test C,Z,P/V,S
Relative form (2 bytes) Test C.Z

A) Unconditional Jump

1) JP addr

• allow the program to transfer control to an instruction at any memory location.

Example:

Address: 1000, Opcode : C3 00 20, Mnemonics : WILD: JP NEXT

Address: 2000, Opcode : C3 00 10, Mnemonics : NEXT: JP WILD

2) Relative Jump

• does not contain the memory address of the next instruction.

• the second byte of this instruction contains the displacement (distance) to the next instruction.

• the displacement is a 8 bits signed number.

Destionation = Program counter + displ. = (Source + 2) + displ.

Example:

Address Opcode Mnemonics

1000    18 0E  WILD:JR NEXT 
1002


1010     18 EE  NEXT:JR WILD

Dest. = (1000 + 2) + 0E
      = 1010 (Forward jump)

Dest. = (1010 + 2) + EE
      = 1000 (Backward jump)

3) Indirect Jump

• allow the program to continue at the memory address pointed to by HL, IX or IY.

Example:


Address  Opcode    Mnemonics

1000    21 00 10  LOOP: LDHL,1000H
1003    E9        JP (HL)

B) Conditional Jump

• allow the programmer to make a choice.

• a condition can be tested by the microprocessor to determine whether or not a jump occurs.

• the condition that are tested by the conditional jumps are the same condition that are held in the flag bits.

• 2 types:

a) long form (3 bytes)...testing C,Z,P/V,S

b) relative form (2 bytes)...testing C,Z

1) Testing the ZERO flag bit

a) JP Z, a16
              { When answer is zero (Z=1), jump
b) JR Z, dd

c) JP NZ, a16
              { When answer is non-zero (Z=0), jump
d) JR NZ, dd

Example:

START : LD B, 10   ; load count
LOOP : ADD HL,HL   ; shift HL left
       DEC B       ; decrement count
       JR NZ, LOOP ; LOOP if B not 0
ENDP : JP ENDP     ; end program

2) Testing the CARRY flag bit

a) JP C, a16  ;C=1, jump
b) JR C, dd

c) JP NC , a16 ; C=0, JUMP
d) JR NC , dd

• the CARRY is often tested after a comparison

Example:

CP 50 H      ; test for 50H
JP NC, 3000H ; jump if A >= 50H
INC A        ; increment A

3) Testing the SIGN flag bit

a) JP M, a 16  ; S=1, negative NO, jump
b) JP P, a16   ; S=0, postive NO, jump

Example:

LD A. (0100H) ; get data
OR A          ; test A
JP P,3000H    ; jump if A = positive

4) Testing the Parity/Overflow flag

• both flags are tested with
  
    • JP PO, a16 (Parity odd, V=1)
    • JP PE, A16 (Parity even, V=0)

Parity Flag

• for logical instructions (AND, OR,XOR)

Example:

LD A, (0110H) ; get data
OR A          ; test A
JP PO, ERROR  ; jump if parity odd

Overflow Flag

• an overflow condition occurs when the signed exceed the +127 or -128.

Example:

LD HL, (1000H) ; get data
LD A,H         ; sum data
ADD A,L
JP PE, OVER    ; jump if overflow

The DJNZ instruction

• it is a very powerful instruction that is a combination of two instructions:

• Dec B
• JR NZ,dd

• counter  (contents of B register) is decrement and tested for a zero condition.

• instruction does not affect any of the flag bits.

Example:

Start: LD HL, 1800H ; get pointer
       LD B,20H     ; load counter
LOOP:  INC (HL)     ; add 1 to contents
       DJNZ LOOP    ; repeat B times
ENDP:  JP ENDP      ; wait

Name: Subroutines 2013-04-14 23:19

Subroutines

• A subroutine is a short sequence of instructions that perform a single task.

• Can be used repeated at many different points within the program.

• Advantages : save memory place as it can be used many time.

• There are two types of instructions:

i) Conditional Call
11) Unconditional Call

• The Call instruction is a combination of the PUSH and JP instructions.

1) Unconditional Call

• When the microprocessor execute a CALL instructions:

a) the contents of the program counter are pushed onto the stack.

b) the program jumps to the memory address stored with the CALL instruction.

c) execute the subroutine.

Example

main program        Stack        subroutine

2000 LD SP, 2100H                2040 LD C,00H
2003 CALL 2040     PUSH 2006H          :
2006 LD A, 01H     SP=20FEH            :
                   PC=2040H            :
2) Conditional CALL

• Test the flag bit indicated by the instruction.

• If the condition tested is true, a call occurs.

• If the condition tested is false, no occurs and next sequential instruction is executed.

• CALL instructions (3 bytes):

Source code          Comment 

CALL C,a16     CALL subroutine on C=1
CALL NC,a16    CALL subroutine on C=0
CALL Z,a16     CALL subroutine on Z=1
CALL NZ,a16    CALL subroutine on Z=0
CALL M,a16     CALL subroutine on S=1
CALL P,a16     CALL subroutine on S=0
CALL PE,a16    CALL subroutine on P/V=1
CALL PO,a16    CALL subroutine on P/V=0

3) RETURN instruction

• The RET (return) instruction is used to return to the main program at the instruction that follows the CALL.

• The RET address of this instruction is stored on the stack.

• The RET instruction POPs a number from the stack and place it into the program counter.

Example:

main program        stack         subroutine

2000 LD SP,2100H                2040 LD C,00H
2003 CALL  2040   1.PUSH 2006H         :
2006   LD A,01H    SP=20FEH            :
                                       :
                                       :
                  2. POP         2045 RET
                     PC=2006H
                     SP=2100H

4) Conditional RET instructions

• The condition RET instruction test the flag bit condition by the instruction.

• If the condition tested is true, the conditional return instruction removes a number from the stack and place it into the program counter

• If the condition tested is false, the return instruction has no effect and program continues with the next sequential instruction.

• Return instructions (1 Byte):

Source Code    Comment

RET C        Return if C=1
RET NC       Return if C=0
RET Z        Return if Z=1
RET NZ       Return if Z=0
RET M        Return if S=1
RET P        Return if S=0
RET PE       Return if P/V=1
RET PO       Return if P/V=0

Example:

        Source Code          Comment

2000  START: LD SP,2100H  ;main program
2003         LD A,1
2005         CALL COMP    ; change sign
2008         CALL COMP    ; change sign
200B  ENDP   JR ENDP      ; wait

2040  COMP:  CPL          ; subroutine
2041         INC A   
2042         RET

5) Restart (RST) instruction

• Are special unconditional Call instructions.

• Call a subroutine that begins at a fixed memory location.

• RST 10H calls the subroutine which begin at memory location 0010H.

• RST 10H is the same as call 0010H except RST 10H is 1 byte instruction, whereas CALL 0010H is 3 bytes instruction.

• RST are used for system subroutine as it reduces memory storage.

• 8 different destination addresses for RST:

RST 0H   RST 20H
RST 8H   RST 28H
RST 10H  RST 30H
RST 18H  RST 38H

Miscellaneous Instructions

1) NOP instruction

• No operation.

• Is used to waste time (4 system clocking period) in programs that required time delay.

2) SCF and CCF instructions

• Are used to control the state of the carry flag bit.

• SCF set carry.

• CCF complements carry.

• If carry flag needs to be clear an SCF followed bt a CCF is used.

3) HALT instruction

• Is used to stop program execution

• The only way that execution continue after a HALT is to reset the microprocessor or from hardware interrupt.

Name: Two-Pass Assembler 2013-04-14 23:23

Assembler: converts source code to object code (machine code)

3 types of assembler:

1. Hand assembler - manual conversion using instruction sets.

2. One-pass assembler or line assembler - auto conversion Adv: saves memory space

3. Two-pass assembler - auto convert source code by passing or scanning twice to create not only object code but label and comment. Adv: allow forward addressing, software jump ahead to an instruction, do not need to give absolute values as addresses and displacement.

The Two Pass Assembler

1) Assembly langauge

• Is a program that converts software written in symbolic machine language (Source program) into hexadecimal machine language.

Source Program e.g LD A, 01H → Assemble Program → Object Program e.g 0000   3E 01   LD A, 01H

2) Two Pass assembler

• The two pass assembler is so called because it convert the source code by scanning the source code twice.

• The first scan, it reads all labels, creates a label table (symbol table), and checks for Improper syntax.

• The second scan, it creates machine code for the microprocessor and store it.

• Advantage: allow forward addressing. This means that the software jump ahead to an instruction in a program.

3) The assemble language statement

• Contains 4 fields:

LABEL  OPCODE  OPERAND  COMMENT

START: LD A,   01H    ; get data
       CALL    SUBR   ;call subroutine

a) Label field

• Label field contains a symbolic memory address that is used to refer to the statement on a program.

• Label are optional and must end with a colon (:).

• Label must begin with a LETTER.

• Vaild and invalid labels:

Label   Vaild/Invaild  Comment

DOGGY:  Valid          All alphabetic characters
DOG12   Valid          All alphabetic characters
SUB:    Invalid        An opcode
D:      Invalid        A register
4DOG    Invalid        Beginning with a number

b) Opcode Field

• The opcode field must always contain a vaild microprocessor opcode or pseudo opcode.

c) Operand Field

• The operand field contain register names, data or label. Data must be encode as decimal, binary, octal, hexadecimal or ASCII.

Operand    Type         Comment
 
100        Decimal      8 or 16 bit quantity
10H        Hexadecimal  8 or 16 bit quantity
12O        Octal        8 or 16 bit quantity
11011001B  Binary       8 or 16 bit quantity
"A"        ASCII        8 bit quantity
"AB"       ASCII        16 bit quantity
"HELLO"    ASCII        Multiple-byte quantity

d) Comment Field

• Must begin with a semicolon or asterisk.

4) Assembler Pseudo Operations

• Assembly language uses pseudo opcode in a source program to facilitate the generation of object code during the assembly process.

• The assembler pseudo operation are directive to the assembly program that may or may not generate machine code.

• Pseudo opcodes are placed in the opcode field.

• Opcode performs specific operation when executed while pseudo opcode does not.

• Summary of Pseudo opcodes:

1. DB    0F8H     Define byte (low byte)
2. DW    0F786H   Define word (value)
3. DEFM  'AAAAA'  Define message.
4. DEFS  128      Define storage (128 bytes)
5. ORG   0FB00H   Origin (Constant)
6. EQU   06799H   Equate (Constant)
7. END            End of assembler
8,  ;             Comments

a) Define Byte (DB)

• Use to define 8-bit data.

Example:

DATA:  DB  1,2,3,4 ; define DATA as 4 bytes
DATA1: DB  100     ; define DATA1 as 100
                   ; decimal
DATA2: DB  0A0H    ; define DATA2 as A0H
DATA3: DB  111B    ; define DATA3 as 111Binary
DATA4: DB  'D'     ; define DATA4 as ASCII D
DATA5  DB 'HELLO'  ; define DATA5 as 10 ASCII
       DB 'THREE'  ; bytes

b) Define Word (DW)

• Use to store 16-bit number in the memory.

Example:

DATA:  DW  1000H   ; define DATA as 1000H
DATA1: DW  10H     ; define DATA1 as 0010H
DATA2: DW  1010B   ; define DATA2 as 1010Binary
DATA3: DW  'AB'    ; define DATA3 as ASCII AB
DATA4: DW  START   ; define DATA4 as label
                   ; START

c) Define Message (DEFM)

• Use to store the ASCII code for each character.

d) Define Storage (DEFS)/DS

• Use to reserves a storage memory space to store the results of the executed instructions

Example:

Label   Opcode  Operand   Comment

BUFFER  DEFS    128      ;define a storage of 128B

e) Origin (ORG)

• Used to change the starting point of the program from location 000H to any other address.

Example:

       ORG 1000H  ; set origin to 1000H
start: LD A,01H
       JP 1000H

f) Equate (EQU)

• Use to assign 's the value of the operand to a label. The value is a 16-bit hexadecimal number.

• Example:

DATA  EQU  0ABCDH  ;ASSIGN ABCDH
                   ; to DATA

f) END

• Any source program should ended with the END pseudo opcode, if not errors might occur.

Example:

       ORG 100
       LD A, ONE
       LD HL, DATA
       JP START
ONE:   EQU 1
DATA:  EQU 100H
START: EQU 100
       END

Macro Assemblers

A special form of the standard assembler that allows programmer to define new opcodes. Instead of using subroutine, macro can be used.

Eg

SWITCH:  MACRO         ;DEFINE NEW OPCODE SWITCH
         PUSH HL       ;SAVE HL
         PUSH BC       ;SAVE BC
         POP HL        ;BC TO HL
         POP BC        ;HL TO BC
         MEND          ;END NEW OPCODE SWITCH

START:   LD BC, 1000H  ;LOAD BC
         LD HL, 2000H  ;LOAD HL
         SWITCH        ;ENVOKE MACRO

Name: Operations of Interrupts 2013-04-14 23:26

Operations of Interrupts

3 types of Interrupts:

1. Software Interrupts E.g. RST nn

2. Reset

3. Hardware Interrupts

a. Non-Maskable Interrupt (INT) - cannot be cancelled by user
b. Maskable Interrupt (NMI) - can be cancelled by user
      Mode 0
      Mode 1
      Mode 2
e.g. IM 0, IM 1, IM 2, EI(enable interrupt) and DI(disable interrupt)

Microprocessor will pushes the current contents of the PC onto the stack.

1. Software Interrupts:

supports 8 software interrupts. They are in the form of Restart instruction. Eg RST 30H

2. RESET:

Reset signal has to be maintained at a LOW level for at least 3 clock cycles.

What does it do?

1. Floats the data and address buses.
2. Sets the interrupt mode to Mode 0
3. Disable IFF1(interrupt Flip Flop 1) and IFF2(Interrupt Flip Flop 2) are cleared
4. Begin an opcode fetch at location 000H

Reset has the highest priority of processing.

3. Hardware Interrupt:

a. Interrupt Enable Flip Flop:

1. IFF1 -

mask/unmask interrupt (enable interrupt or disable interrupt)

IFF1 = 1 enable interrupt - allow interrupt (using EI instruction)

IFF2 = 0 disable interrupt - disallow interrupt (using DI instruction)

2. IFF2 -

temporary storage for IFF1 when NMI is received. IFF2 is restored to IFF1 when program returns from the NMI service routine.

Name: Anonymous 2013-04-14 23:58

>>34-37
le obsolete Z80 crap
If it ain't MIPS, it's crap.

Name: Anonymous 2013-04-15 0:02

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Name: Motorola Tech Geek 2013-04-15 5:51

>>38

Are you sure the above code are just only Z80? It also look like the function of an Motorola Microprocessor to me.

Name: Anonymous 2013-04-15 8:11

Can you review my code?


nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop


thanks

Name: Anonymous 2013-04-15 13:01

>>40
JP cond, dest; JP (HL); JR; conditional CALL/RET; IX; IY; DJNZ; SCF/CCF; RST for software interrupts
Yep, all Z80.

Name: Anonymous 2013-04-15 13:04

>>41
Typical microcontroller code.

Name: Anonymous 2013-04-15 15:41

>>41
nope

Name: Anonymous 2013-04-15 20:36

>>44
emin duds dro

Name: Anonymous 2013-04-16 11:31

xcvcx

Name: Anonymous 2013-04-17 0:22



Searching for legit Microsoft Products keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com


Searching for legit Microsoft Products keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com


Searching for legit Microsoft Products keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

Name: Anonymous 2013-04-17 0:35



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 0:39



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 0:43



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 0:46



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 0:50



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 0:54



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 0:58



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 1:01



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 1:05



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 2:58



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:11



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:15



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:19



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:22



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:27



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:30



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:34



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:38



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:42



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-17 8:46



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-08-04 0:09

The Art of Assembly Language Programming : http://cs.smith.edu/~thiebaut/ArtOfAssembly/artofasm.html

Name: Anonymous 2013-08-04 0:15

>>68
That's not Assembly Language, that's Mr. PDF's bastardized "high level" shite.

Don't change these.
Name: Email:
Entire Thread Thread List