Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

masm_shc string inline error #1

Closed
b1tg opened this issue Feb 1, 2021 · 1 comment
Closed

masm_shc string inline error #1

b1tg opened this issue Feb 1, 2021 · 1 comment

Comments

@b1tg
Copy link
Contributor

b1tg commented Feb 1, 2021

masm_shc string inline error

reproduce

source file test.cpp:

#include <stdio.h>
void main() {
    char* temp[] = {"123", "xxx", "bbb"};
    return;
}

use test.bat to build:

cl /c /FA /GS- test.cpp
masm_shc.exe test.asm test_a.asm
ml test_a.asm /link /entry:main

cl.exe output test.asm:

; Line 7
	mov	DWORD PTR _temp$[ebp], OFFSET $SG5652
	mov	DWORD PTR _temp$[ebp+4], OFFSET $SG5653
	mov	DWORD PTR _temp$[ebp+8], OFFSET $SG5654
; Line 8

masm_shc.exe output test_a.asm:

; Line 7
	CALL after_$SG5652
$SG5652	DB	'123', 00H
after_$SG5652:
	POP  DWORD

; 	mov	DWORD PTR _temp$[ebp], OFFSET $SG5652
	CALL after_$SG5653
$SG5653	DB	'xxx', 00H
after_$SG5653:
	POP  DWORD

expect:

POP DWORD PTR _temp$[ebp]

actual:

POP DWORD
@hasherezade
Copy link
Owner

Thank you for your contribution, it works very well now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants