Posts

Showing posts with the label 8051

Correct Template for an Assembly Program

Image
Clash Royale CLAN TAG #URR8PPP Correct Template for an Assembly Program I have just started off with assembly and was looking at some sample programs shared by the instructor, for example, the below program to swap 2 numbers. ORG 0h ; This line tells the MCR to place the first instruction at add 0 LJMP main ; This line transfers the control to the main block unconditionally ORG 100h ; Why do we need this? The code if for the 8051 which has a total RAM range ; of 256B, so this address seems out of range main: MOV 70H,#20H MOV 71H,#21H MOV A,70H MOV 70H,71H MOV 71H,A ; The accumulator A acts like a temp in a simple C program HERE:SJMP HERE ; What is the purpose of this line? END Kindly help in resolving my questions (as code comments) about this template By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie poli...