8051

Why 8051 don't have R0 to R32

浪尽此生 提交于 2021-02-11 15:48:17
问题 In 8051 memory bank (00h to 1Fh), 8051 provide 32 registers as 8 registers(R0 t0 R7) to each of 4 banks. Why these registers are not given as R0 to R31? Thanks in Advance.. 回答1: Many instruction opcodes are only 8 bits long; if all 32 registers were accessible in one of these instructions then there would be only 3 bits left to encode the instruction length and the operation. Similarly, two byte instructions often use the second byte to encode a full 8-bit operand (eg., an address), and have

Why 8051 don't have R0 to R32

你离开我真会死。 提交于 2021-02-11 15:47:26
问题 In 8051 memory bank (00h to 1Fh), 8051 provide 32 registers as 8 registers(R0 t0 R7) to each of 4 banks. Why these registers are not given as R0 to R31? Thanks in Advance.. 回答1: Many instruction opcodes are only 8 bits long; if all 32 registers were accessible in one of these instructions then there would be only 3 bits left to encode the instruction length and the operation. Similarly, two byte instructions often use the second byte to encode a full 8-bit operand (eg., an address), and have

Add two 32-bit numbers using 8-bit registers

匆匆过客 提交于 2021-02-10 14:39:48
问题 The goal here is two add two 32-bit numbers stored in little-endian notation. The numbers are stored in the following memory cells: first number: 0x3000-0x3003 seconds number: 0x4000-0x4003 the result should go into: 0x5000-0x5003 The following is my implementation, that is not very efficient in terms of DRY principle: ARG1 EQU 3000H ARG2 EQU 4000H RESULT EQU 5000H ORG 0000H MOV DPTR, #ARG1 + 0 MOV A, #12H MOVX @DPTR, A MOV DPTR, #ARG1 + 1 MOV A, #34H MOVX @DPTR, A MOV DPTR, #ARG1 + 2 MOV A,

What will be the size of pointer on a 8 bit microcontroller like 8051?

陌路散爱 提交于 2021-01-29 02:47:26
问题 We know that size of the pointer depends on address bus,so what will be the size of pointer on 8 bit microcontroller like 8051? 回答1: The 8051 is not a C friendly processor. It has several address spaces. I used the Keil 8051 compiler extensively and it had several pointer types. An 8 bit pointer to point at the internal memory space or internal indirect space. A 16 bit pointer to point to either external ram or code space. A "smart" 24 bit pointer that could point anywhere. Basically a tag

8051 LCD 'Hello World' - replacing DB with variable

橙三吉。 提交于 2020-01-12 11:10:27
问题 I'm using a proprietary 8051 board to learn assembly programming. I'm currently working on an LCD 'Hello World' program. Here's the code. lcd_cmd equ 0800h ;Write COMMAND reg address 0800h lcd_st equ 0801h ;Read STATUS reg address 0801h lcd_wr equ 0802h ;Write DATA reg address 0802h lcd_rd equ 0803h ;Read DATA reg address 0803h ORG 08100h hello: mov P2, #(lcd_cmd SHR 8) ;load P2 with high address mov R0, #(lcd_cmd AND 255) ;load R0 with command reg addr mov R7, #03h ;set LCD position, line=1,

basic requirements to be called RTOS for 8051

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 13:06:22
问题 I want to make an RTOS for 8051 and very confused as what minimum requirements should be followed to make an OS in 8051 as 8051 has very limitted resources in case of RAM and ROM. It is just and assignment type problem but i am really confused as we make softwares for 8051 are they not an OS? which features differenciate a normal regular coding of micro controller from RTOS? please help thanks 回答1: An typical RTOS provides at least the following: Deterministic task scheduling Task

basic requirements to be called RTOS for 8051

核能气质少年 提交于 2020-01-04 13:06:15
问题 I want to make an RTOS for 8051 and very confused as what minimum requirements should be followed to make an OS in 8051 as 8051 has very limitted resources in case of RAM and ROM. It is just and assignment type problem but i am really confused as we make softwares for 8051 are they not an OS? which features differenciate a normal regular coding of micro controller from RTOS? please help thanks 回答1: An typical RTOS provides at least the following: Deterministic task scheduling Task

Do all C compilers allow functions to return structures?

≡放荡痞女 提交于 2020-01-04 06:24:22
问题 I am working on a program in C and using the SDCC compiler for a 8051 architecture device. I am trying to write a function called GetName that will read 8 characters from Flash Memory and return the character array in some form. I know that it is not possible to return an array in C so I am trying to do it using a struct like this: //********************FLASH.h file******************************* MyStruct GetName(int i); //Function prototype #define NAME_SIZE 8 typedef struct { char Name[NAME

8051 external interrupt

不想你离开。 提交于 2019-12-23 09:14:48
问题 how to enable external interrupt of 8051? 回答1: Each of the 8051s interrupts has its own bit in the interrupt enable ( IE ) special function register (SFR) and is enabled by setting the corresponding bit. The code examples below are in 8051 assembly as well as C to provide a general idea of what is taking place. To enable external interrupt 0 ( EX0 ) you need to set bit 0 of IE . SETB EX0 or ORL IE,#01 or MOV IE,#01 To enable external interrupt 1 ( EX1 ) you need to set bit 3 of IE . SETB EX1

What is the best C compiler for the 8051 family? [closed]

耗尽温柔 提交于 2019-12-20 17:39:58
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . We are starting a new project based on an 8051 microcontroller. Questions: What is the best C compiler to use? Are there any open source 8051 compilers and how good are they? 回答1: Keil is what I have used with this microcontroller in the past. They've got a pretty good set of