home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
LA
/
LA026.ZIP
/
LN2.SIM
< prev
next >
Wrap
Text File
|
1990-10-14
|
3KB
|
154 lines
te1 qc
!
!
!
! ┌──────────────────────┐
! │ WELCOME TO LESSON 2 │
! └──────────────────────┘
!
!
!
qp
! This lesson let you learn how to
! enter a 6502's mini assembly program
! which will print from 1 to 9 on the terminal.
!
! First you need to activate the 6502 simulator.
!
fc 6502
!
! The next command sets the input address of
! the mini assembly syntax to start at 1000.
!
pa1000
!
! Those command lines which follow and begin
! with 'a' will be assembled into machine codes.
!
qp
!
a LDX #$31
!
! Only hexadecimal values (#$) can be
! accepted by this 1.1 version.
a TXA
a INX
a CSO A
!
! "CSO A" is a non-6502 assembly instruction
! which was built in for your convenience to
! display the content of the accumulator on your terminal.
a CPX #$3A
a BNE $1002
a STP
! "STP" is another non-6502 assembly instruction
! which was built in for your convenience.
qp
!
! The next command will save this 6502's
! assembly program into file 6502.ump
! in UMPS format.
!
fw u 6502 1000 30
!
! You can also save your file
! in b (binary), i (Intele),
! or m (Mostek) instead of u (UMPS).
!
qp
!
! The next command sets sSA to start at $1000
! to begin the execution of the program.
!
ps1000
!
! The next command executes the first instruction step.
!
s
!
! The first line shows the next instruction and
! its machine code after the execution of one step.
! The second and the third lines show the
! content of all the registers and flags.
qp
!
! The next command will execute
! the rest of the program.
! The result "123456789" will be printed out.
!
sg
!
qp
!
! If you want to print out 5 to 8 instead of 1 to 9,
! the contents of location $1001 and $1006 need
! to be $35 and $39, respectively.
! The following commands will make the changes.
!
! Enter hexadecimal number 35 for location 0x1001.
!
pi1001
ix 35
!
! Then enter the decimal number 57 (0x39)
! for location 0x1006.
!
pi1006
id 57
!
qp
!
! To see the whole program after this modification
! assign dSA at 0x1000 to start the disassembler
! and display 0x7 instrucion codes.
!
pd1000
!
d7
!
qp
!
!
! What is all of the SAs now?
!
pp
!
! To execute the newly changed program the
! sSA needs to be changed from 100A to 1000.
!
ps1000
!
! The result "5678" will be printed out.
!
sg
!
qp
!
! Use the next command to load the original
! file back into the default location $1000.
!
fr u 6502
!
! Do you want to see the changes?
! What commands do you need?
!
qp
!
! There are files named 6800.UMP, 8085.UMP and z80.UMP
! for users of MPU's other than the 6502 to practice UMPS.
! These files with the extension ".UMP" provides
! the same function as 6502.UMP file.
!
! Files 6502.BIN, 6502.INT and 6502.MOS
! are included for your reference.
! These files and file 6502.UMP have the same
! original data but are stored in different data formats.
!
! When you use "fr" command to read a ".BIN" file
! you always need to specify the destination.
!
! Use the command "fb ln3"
! to learn the UMPS lesson 3.
! Use the command "qq" to exit from UMPS.
!