We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
void test() { #pragma asm MOV R0,#55H #pragma endasm } this code generates A45 error:undefined symbol
If you just mindlessly keep reposting the same question withou answering the requests in the previous posts, the jack of diamond will be a king before your problem get solved. WErik
You ARE using the SRC directive, aren't you? When I compile your example, I get the following .SRC file.
; .\main.SRC generated from: main.c ; COMPILER INVOKED BY: ; C:\Keil\C51\BIN\C51.EXE main.c ; BROWSE DEBUG OBJECTEXTEND CODE ; PREPRINT SRC(.\main.SRC) NAME MAIN ?PR?test?MAIN SEGMENT CODE PUBLIC test ; void test() RSEG ?PR?test?MAIN test: ; SOURCE LINE # 1 ; { ; SOURCE LINE # 2 ; #pragma asm ; MOV R0,#55H MOV R0,#55H ; #pragma endasm ; } ; SOURCE LINE # 6 RET ; END OF test END
A51 MACRO ASSEMBLER MAIN 09/16/2004 10:10:27 PAGE 1 MACRO ASSEMBLER A51 V7.09 OBJECT MODULE PLACED IN main.OBJ ASSEMBLER INVOKED BY: C:\Keil\C51\BIN\A51.EXE main.SRC SET(SMALL) DEBUG EP LOC OBJ LINE SOURCE 1 ; .\main.SRC generated from: main.c 2 ; COMPILER INVOKED BY: 3 ; C:\Keil\C51\BIN\C51.EXE main.c ; BROWSE DEBUG OBJECTEXTEND CODE ; PREPRINT SRC(.\main.SRC) 4 5 6 NAME MAIN 7 8 ?PR?test?MAIN SEGMENT CODE 9 PUBLIC test 10 ; void test() 11 ---- 12 RSEG ?PR?test?MAIN 0000 13 test: 14 ; SOURCE LINE # 1 15 ; { 16 ; SOURCE LINE # 2 17 ; #pragma asm 18 ; MOV R0,#55H 0000 7855 19 MOV R0,#55H 20 ; #pragma endasm 21 ; } 22 ; SOURCE LINE # 6 0002 22 23 RET 24 ; END OF test 25 26 END SYMBOL TABLE LISTING ------ ----- ------- N A M E T Y P E V A L U E ATTRIBUTES ?PR?TEST?MAIN. . . C SEG 0003H REL=UNIT MAIN . . . . . . . N NUMB ----- TEST . . . . . . . C ADDR 0000H R SEG=?PR?TEST?MAIN REGISTER BANK(S) USED: 0 ASSEMBLY COMPLETE. 0 WARNING(S), 0 ERROR(S)
void test() { #pragma asm MOV R0,#55H #pragma endasm }