Xref: utzoo comp.lang.pascal:6578 comp.sys.ibm.pc.hardware:8381 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!hp4nl!rulway.LeidenUniv.nl!rulcri!vereijken From: vereijken@rulcri.leidenuniv.nl (Jan Joris Vereijken) Newsgroups: comp.lang.pascal,comp.sys.ibm.pc.hardware Subject: V20/V30 BCD string instructions Message-ID: <1991May4.221139.1@rulcri.leidenuniv.nl> Date: 4 May 91 21:11:39 GMT Sender: news@rulway.LeidenUniv.nl (Usenet news account) Organization: Leiden University Computer Centre Lines: 32 Nntp-Posting-Host: rulcr1 Hi, I'm trying to write a BCD toolkit in Turbo Pascal 6.0. Interestingly, I own a V30 based PC-clone. The NEC V30 chip, a 8086 clone, has several insturctions the 8086 does not have. Among them are ADD4S, SUB4S and CMP4S, which add, subtract and compare whole BCD strings in 1 instruction (not unlike MOVS moves a string). I managed to set up the strings, the pointers to source and destination, and the digit count. Then when when I do an ADD4S, the addition gets done, correctly! However, every once in a while the computation of ADD4S(x,y) does not yield "x+y", but "x+y+1" instead. Weird! The sensible thing to conclude is: the carry flag gets also added to the sum. Wrong bet, clearing the carry (CLC just before the ADD4S) doesn't cure the problem. I also tried setting AX to zero, no cure either. Just in case you want to know: I have the original NEC V30 datasheet, and it doesn't help me out on this one. (altough it did a great job on teaching me how to run the V30 in 8080 (as in CP/M-80) compatibility mode, another nice V30 feature) Anyone any clues, please? Thanx in advance! - Jan Joris Vereijken - forchk@hlerul53.bitnet, forchk@rullf2.LeidenUniv.NL PS: I do not have regular access to netnews, could you also mail me privately?