| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Assembly Questions and Answers for Assembly here! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Assembler language program help
maxbotix.com EZ0 sensor
Above is a simple distance sensor I bought. I want to turn on LED's for a distance to a wall "proximity warning device". RED = stop! Amber = Warning prepare to stop Green = ok to drive I will simulate using a Dragon 12+ plus microcontroller board and debug 12. I need code for this in Assembler language. Note: Once I have it I want to consider sounds such that: RED led = constant warning chime Yellow = slow beep Green = no beep Flashing red LED = you are closer than 1.0 feet to a wall and are about to hit. I will use the AN analog o/p of the maxbotix sensor. The device turns out a voltage corresponding to the distance. So, when you are at 5 feet or greater from a wall we should turn on a green LED. If we are at 2.5 to 4.9 feet we should turn on a Yellow led. If we are at 2.4 feet to 1.5 feet = red. I have the idea that anything under 1.4 to 0 feet should flash a red led!!! This is a simulation I am doing. Does anyone know how to go about illuminating external LED's that are breadboarded onto the Dragon 12+ microcontroller? It is NOT codewarrior so I have been having difficulty finding any example scripts. It is in Debug 12, 68hcs12, Assembler language prgramming. |
|
#2
|
|||
|
|||
|
Re: Help using assembly language creating a calculator
pls help me..i im nobe in assembly language i dont know the nxt step.
this is the code but i dont know the nxt a100 mov ax, 00 int 33 mov ax, 01 int 33 mov ax, 03 int 10 mov ah, 02 mov dx, 001c mov bh, 00 int 10 mov ah, 09 mov dx, 01d3 int 21 mov ah, 02 mov dx, 031c int 10 mov ah, 09 mov dx, 0228 int 21 mov ah, 02 mov dx, 041d int 10 mov ah, 09 mov dx, 01de int 21 mov ah, 02 mov dx, 051c int 10 mov ah, 09 mov dx, 01e7 int 21 mov ah, 02 mov dx, 061a int 10 mov ah, 09 mov dx, 01f3 int 21 mov ah, 02 mov dx, 071d int 10 mov ah, 09 mov dx, 0202 int 21 mov ah, 02 mov dx, 0a1e int 10 mov ah, 09 mov dx, 0232 int 21 mov cx, 0000 mov dx, 0000 mov bx, 0000 mov ax, 03 int 33 cmp bx, 1 jne 017c cmp cx, 0120 jg 17c cmp cx, 00d0 jl 17c cmp dx, 0020 je 01ad cmp dx, 0028 je 01b2 cmp dx, 0030 je 01b7 cmp dx, 0038 je 01bc cmp dx, 0050 je 01d1 jne 17c mov dx, 020b jmp 01bf mov dx, 020f jmp 01bf mov dx, 0218 jmp 01bf mov dx, 0221 mov ah, 02 mov bx, 0000 mov di, dx mov dx, 0c1d int 10 mov dx, di mov ah, 09 int 21 int 20 db "Calculator$" db "Addition$" db "Subtraction$" db "Multiplication$" db "Division$" db "Add$" db "Subtract$" db "Multiply$" db "Divide$" db "Menu$" db "Exit$" this is the frame menu add sub mul divide exit 1st screen The 1st frame nid to be clicakble to do the 2 screen frame example if u click the a,d,d,i.t,i,o,n any of the letters we going to second frame to do the operation the same in subtraction and multiplication but the division nid a two answer the quotient and remainder 1st number___ 2nd number___ result___ press any key 2 return to menu second screen note 3 digits max including negative value and the numbers be in ascii code... pls help me..tnx |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|