Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Christian Zietz Newsgroups: de.comp.sys.atari Subject: Re: Thing 1.50 Date: Sat, 19 Dec 2015 19:40:14 +0100 Lines: 56 Message-ID: References: <201512191836.a62267@b.maus.de> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: individual.net GnqO7dSPcGuzVIlWXetpsgt1M7ftYuxgADffY+s79/n3mP/g== Cancel-Lock: sha1:HxxtyGRzZkQxc/OacHVV3KJOd1c= X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: <201512191836.a62267@b.maus.de> Xref: csiph.com de.comp.sys.atari:688 Gerhard Stoll schrieb: > int Getcookie (long cookie, long *p_value) > > /* Ssystem supported, use it */ > int r; > long v = -42; [...] > r = (int) Ssystem(S_GETCOOKIE, cookie, &v); > /* > * Backward compatibility for MiNT 1.14.7: > * Ssystems() returns cookie value and ignores arg2!! > */ > if (r != -1 && v == -42) > v = r; [...] > if (p_value) > *p_value = v; > Ich sehe da keinen Fehler und bei mir geht es ja. Ich sehe einen möglichen Fehler -- der auch zum im Forum berichteten Absturz passt -- im Code-Pfad "Backward compatibility for MiNT 1.14.7". Offenbar ist "int" nur 16 Bit breit und damit wird der Cookie (32 Bit) in diesem Fall nicht komplett ausgelesen. Code aus THING.APP: 0004C8E8 lea (sp),a0 ; arg2 0004C8EA move.l d3,d1 ; arg1 0004C8EC moveq #8,d0 ; S_GETCOOKIE 0004C8EE jsr sub_508A8 ; Ssystem 0004C8F4 cmp.w #-1,d0 0004C8F8 beq.s loc_4C906 0004C8FA moveq #-42,d1 0004C8FC cmp.l (sp),d1 0004C8FE bne.s loc_4C906 0004C900 move.w d0,d2 ; <--- nur 16 Bit des Rückgabewerts... 0004C902 ext.l d2 ; <--- ... werden abgelegt 0004C904 move.l d2,(sp) Der berichtete Absturz äußerte sich in der Tat so, dass die unteren 16 Bit des Cookies wohl korrekt gelesen wurden, die oberen 16 Bit (aufgrund von "sign extension") aber 0xFFFF waren. Christian -- Christian Zietz - CHZ-Soft - czietz (at) gmx.net WWW: http://www.chzsoft.de/ PGP/GnuPG-Key-ID: 0x52CB97F66DA025CA / 0x6DA025CA