@@ -71,7 +71,19 @@ struct HugeSectorBlock {
7171/* functions with SS != DGROUP. The code for this function happens to */
7272/* to compile under gcc-ia16 to correctly-behaving code _for now_. But */
7373/* it will be better to be able to guarantee this. -- tkchia 20191207 */
74+
75+ /* Update: I added experimental SS != DGROUP support, and a __seg_ss */
76+ /* address space qualifier, to gcc-ia16 around January 2020. This */
77+ /* function now uses these if available. In particular, the iregs *irp */
78+ /* structure will always be on the stack, so (as far as the calling */
79+ /* convention permits) the function can treat the irp pointer as a */
80+ /* 16-bit pointer relative to SS. -- tkchia 20200417 */
81+ #if defined __GNUC__ && defined __IA16_FEATURE_ATTRIBUTE_NO_ASSUME_SS_DATA
82+ __attribute__((no_assume_ss_data ))
83+ VOID ASMCFUNC int21_syscall (iregs __seg_ss * irp , ...)
84+ #else
7485VOID ASMCFUNC int21_syscall (iregs FAR * irp )
86+ #endif
7587{
7688 Int21AX = irp -> AX ;
7789
@@ -150,7 +162,7 @@ VOID ASMCFUNC int21_syscall(iregs FAR * irp)
150162
151163 /* Get DOS-C release string pointer */
152164 case 0xff :
153- #ifndef __GNUC__
165+ #if !defined __GNUC__ || defined __IA16_FEATURE_ATTRIBUTE_NO_ASSUME_SS_DATA
154166 irp -> DX = FP_SEG (os_release );
155167#else /* TODO: remove this hacky SS != DGROUP workaround --tkchia 20191207 */
156168 asm volatile ("movw %%ds, %0" : "=g" (irp -> DX ));
0 commit comments