bracketslash
Registered User
- Joined
- Feb 6, 2013
- Messages
- 224
Wrote this up, figured that some of you might be interested in seeing it.
It searches memory locations E000 through E0FF and counts how many of these memory locations contains zeroes.
This is written for a 6502 (8-bit) microprocessor.
Pretty basic ASM example.
Here's a quick sum-up of ASM for those who have no clue what it is: ASM is the most unambiguous, low-level (besides machine code) programming language there is. Every command has one and only one corresponding machine code instruction. Assembly language is processor-specific. Assembly language (aims to) use hexadecimal which has a one-to-one correlation to binary. All of this combined gives you utmost control over the processor and memory but a major downside is that it may take 100 lines to do something that may take 1 line in any higher-level programming language.
Hope you enjoyed it
It searches memory locations E000 through E0FF and counts how many of these memory locations contains zeroes.
This is written for a 6502 (8-bit) microprocessor.
org 200h
ldx #0d ; clear the X register
ldy #0d ; clear the Y register
NextX *
lda 0e000h,x ; load E000+X into A register
cmp #0d ; compare the A register to 0
beq IncY ; if the A register == 0, IncY
inx ; increment the X register
cpx #0ffh ; compare the X register to 255
bne NextX ; if the X register != 255, NextX
sty 0275h ; store the Y register into memory location 0275
brk ; end the program
IncY *
iny ; increment the Y register
inx ; increment the X register
jmp NextX ; jump to NextX
end
Pretty basic ASM example.
Here's a quick sum-up of ASM for those who have no clue what it is: ASM is the most unambiguous, low-level (besides machine code) programming language there is. Every command has one and only one corresponding machine code instruction. Assembly language is processor-specific. Assembly language (aims to) use
Hope you enjoyed it